/*
 * @(#)CSTransformer.java
 * Date 2013-09-27
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.hl7v3common.transformer;

import javax.enterprise.context.ApplicationScoped;

import org.hl7.v3.CS;

import us.hornerscorners.lamppost.hl7v3common.constant.AckResponse;
import us.hornerscorners.lamppost.hl7v3common.constant.AckSetting;
import us.hornerscorners.lamppost.hl7v3common.constant.HL7Constant;
import us.hornerscorners.lamppost.hl7v3common.constant.ProcessingCode;
import us.hornerscorners.lamppost.hl7v3common.constant.ProcessingMood;
import us.hornerscorners.lamppost.hl7v3common.constant.StatusCode;

import us.hornerscorners.lamppost.transformer.AbstractTransformer;


/**
 * Class description
 *
 *
 * @version        v1.0, 2013-09-27
 * @author         Jim Horner
 */
@ApplicationScoped
public class CSTransformer extends AbstractTransformer<String, CS> {

    /**
     * Constructs ...
     *
     */
    public CSTransformer() {
        super();
    }

    /**
     * Method description
     *
     *
     * @param ackResponse
     *
     * @return
     */
    public CS transform(AckResponse ackResponse) {

        return transform(ackResponse.getCode(), null, null);
    }

    /**
     * Method description
     *
     *
     * @param ackSetting
     *
     * @return
     */
    public CS transform(AckSetting ackSetting) {

        return transform(ackSetting.getCode(), null, null);
    }

    /**
     * Method description
     *
     *
     * @param hl7Constant
     *
     * @return
     */
    public CS transform(HL7Constant hl7Constant) {

        return transform(hl7Constant.getCode(), null, null);
    }

    /**
     * Method description
     *
     *
     * @param processingCode
     *
     * @return
     */
    public CS transform(ProcessingCode processingCode) {

        return transform(processingCode.getCode(), null, null);
    }

    /**
     * Method description
     *
     *
     * @param processingMood
     *
     * @return
     */
    public CS transform(ProcessingMood processingMood) {

        return transform(processingMood.getCode(), null, null);
    }

    /**
     * Method description
     *
     *
     * @param statusCode
     *
     * @return
     */
    public CS transform(StatusCode statusCode) {

        return transform(statusCode.getCode(), null, null);
    }

    /**
     * Method description
     *
     *
     * @param code
     *
     * @return
     */
    @Override
    public CS transform(String code) {

        return transform(code, null, null);
    }

    /**
     * Method description
     *
     *
     * @param code
     * @param codeSystem
     *
     * @return
     */
    public CS transform(String code, String codeSystem) {

        return transform(code, codeSystem, null);
    }

    /**
     * Method description
     *
     *
     * @param code
     * @param codeSystem
     * @param systemName
     *
     * @return
     */
    public CS transform(String code, String codeSystem, String systemName) {

        CS result = new CS();

        result.setCode(code);
        result.setCodeSystem(codeSystem);
        result.setCodeSystemName(systemName);

        return result;
    }
}
